% cc -o myprog myprog.c
The cc compiler compiles myprog.c into an executable called myprog.
% pixie myprog
pixie takes myprog and writes an equivalent program, myprog.pixie, containing additional code that counts the execution of each basic block. pixie also writes an equivalent program for each shared object used by the program (in the form: libname.so.pixie), containing additional code that counts the execution of each basic block. For example, if myprog uses libc.so.1, pixie generates libc.so.1.pixie.
% setenv LD_LIBRARY_PATH .
% myprog.pixie
This program generates a list of basic block counts in files named myprog.Counts. If the program executes a fork/sproc, a process ID is appended to the end of the filename (for example, myprog.Counts.345) for each process.
% prof -pixie myprog myprog.Counts
prof extracts information from myprog.Counts and prints it in an easily readable format. If multiple .Counts files exist, you can use the wildcard character (*) to specify all of the files.
% prof -pixie myprog myprog.Counts*
Note: Specifying myprog.Counts is optional; prof searches by default for names having the form prog_name.Counts. You can run the program several times, altering the input data, to create multiple profile data files. See "Example Using prof -pixie -dis" later in this section for an example.
The time computation assumes a "best case" execution; actual execution may take longer. This is because the time includes predicted stalls within a basic block, but not actual stalls that may occur entering a basic block. Also it assumes that all instructions and data are in cache (for example, it excludes the delays due to cache misses and memory fetches and stores).
The complete output of the -pixie option is often extremely large. Use the -quit option with prof to restrict the size of the output. Refer to "Running the Profiler" for details about prof options.
Include or exclude information on specific procedures within your program by using the prof options -only or -exclude (explained in Table 4-1). prof timings reflect only time spent in a specific procedure, not time spent including procedures called by that procedure. The CASEVision/WorkShop toolset, an optional software product, can show an estimate of inclusive times.
Figure 4-2 : How Basic Block Counting Works